package com.aabte.design2.behavioral.memento.v2;

import lombok.Data;

/**
 * @author Daniel
 * @version 1.0
 * @date 2020/5/4
 */
@Data
public class Editor implements Originator {
    private String text;
    private int curX;
    private int curY;
    private int selectionWidth;

    public void setCursor(int curX, int curY) {
        this.curX = curX;
        this.curY = curY;
    }

    @Override
    public Memento save() {
        return new Snapshot(this, text, curX, curY, selectionWidth);
    }
}
